package aam.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import aam.model.board.BoardDao;
import aam.model.board.BoardVO;
import aam.model.member.MemberDao;
import aam.model.member.MemberVO;

@Service
public class AdminServiceImpl implements AdminService
{
	@Resource(name="memberDaoImpl")
	private MemberDao memberDao;
	
	@Resource(name="boardDaoImpl")
	private BoardDao boardDao;
	
	@Override
	public void updatePoint(String nick, String operator, int point) 
	{
		System.out.println("updatePoint service");
		if(operator.equals("minus"))
		{
			point = point*(-1);
		}
		MemberVO vo = new MemberVO();
		vo.setNick(nick);
		vo.setFloatingPoint(point);
		memberDao.updatePoint(vo);
	}
	@Override
	public List<String> getBoardList() 
	{
		return boardDao.getBoardList();
	}
	@Override
	public void movePost(int postNo, String boardName) 
	{
		BoardVO vo = new BoardVO();
		vo.setNo(postNo);
		vo.setBoardKind(boardName);
		boardDao.movePost(vo);
	}
	@Override
	public List<MemberVO> memberList() throws Exception {
		return this.memberDao.memberList();
	}
	@Override
	public int updateMember(MemberVO mvo) throws Exception {
		return this.memberDao.updateMember(mvo);
	}
	@Override
	public MemberVO nickCheck(String nick) throws Exception {
		return this.memberDao.nickCheck(nick);
	}
	@Override
	public List<String> gradeList() throws Exception {
		return this.memberDao.gradeList();
	}
	@Override
	public int memberdelete(String id) throws Exception {
		return this.memberDao.memberdelete(id);
	}
}